// 权限管理相关API
import request from '@/utils/request'

// 获取所有权限点
const getPermissionListAPI = () => request.get('/sys/permission')

// 添加权限
const addPermissionAPI = (data) => request.post('/sys/permission', data)

// 更新权限
const updatePermissionAPI = (data) =>
  request.put(`/sys/permission/${data.id}`, data)

// 删除权限
const delPermissionAPI = (id) => request.delete(`/sys/permission/${id}`)

// 根据ID获取权限点详情
const getPermissionDetailById = (id) => request.get(`/sys/permission/${id}`)

export {
  getPermissionListAPI,
  addPermissionAPI,
  updatePermissionAPI,
  delPermissionAPI,
  getPermissionDetailById
}
